package login;

import conts.Accounts;
import util.InputUtil;

/**
 * @classname:index
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/31 16:26
 * @version: 0.1
 * @since:1.8
 */
public class Index {
    public static void main(String[] args) {
        login();
    }

    public static void login() {
        System.out.println("请输入用户名");
        String name = InputUtil.inputNextStr();
        System.out.println("请输入密码");
        String pass = InputUtil.inputNextStr();
        check(name,pass);
    }

    public static void check(String name, String pass) {
        if(Accounts.ADMIN_USERNAME.equals(name)&&Accounts.ADMIN_PASSWORD.equals(pass)){
            System.out.println("管理员登陆成功");
            Admin admin = new Admin();
            admin.showMethod();
        }
        if(Accounts.CASHIER_USERNAME.equals(name)&&Accounts.CASHIER_PASSWORD.equals(pass)){
            System.out.println("收银员登陆成功");
            Cashier cashier  = new Cashier();
            cashier.showMethod();
        }
    }

}
